//    Copyright (C) Kherty.  All rights reserved.
#region

using System.Diagnostics.Contracts;
using System.Windows;
using System.Windows.Media;
using OpenLS.Drawing;

#endregion

namespace OpenLS.Spreadsheet.UI.Internals
{
    internal class CellTextRunProperties : CellTextRunPropertiesBase
    {
        public CellTextRunProperties(EditedCell editedCell, ColorScheme colorScheme)
        {
            Cell cell = editedCell.Cell;
            _typeFace = SpreadsheetFont.CreateTypeface(cell.FontFamily, cell.FontStyle, cell.FontWeight);
            _foregroundBrush = ColorToBrushConverter.GetBrush(cell.ActualForeground, colorScheme);
            _backgroundBrush = FillToBrushConverter.GetBrush(cell.ActualBackground, colorScheme);
            _size = cell.FontSize * 4d / 3d;
        }
    }
}